﻿@using Smarly.Web.Helpers
@model Smarly.Bussines.Model.Account.RepearPassword

<script type="text/javascript">
	$().ready(function () {
		var $form = $('form.account-repair-password')
		$form.smarlyValidation({
			accountRepearUrl: $form.attr('action'),
			onSuccess: function (data, form) {
				var $updateForm = $('form.account-update-password');
				$('#Email', $updateForm).val($('#@Html.IdFor(x => x.Email)', form).val());
				$('[data-dismiss="modal"] form.account-repair-password').hide();
				$updateForm.show();
			},
			onError: function () {
				$('form.account-update-password').hide();
				$('[data-dismiss="modal"] form.account-repair-password').show();
			}
		});
	});
</script>


@using (Html.BeginForm("Repear", "Account", new { area = "" }, FormMethod.Post, new { @class = "account-repair-password" }))
{
	<div class="center">
		@Html.TextBoxFor(x => x.Email, new { type = "email", placeholder = "Email", @class = "icon" })
	</div>

	<div class="center">
		<div class="right">
			<button class="btn" type="submit"><i class="icon-ok icon-white"></i>&nbsp;Получить код востановления</button>
			<button class="btn" data-dismiss="modal"><i class="icon-remove"></i>&nbsp;Отмена</button>
		</div>
	</div>
}

